package com.mallcloud.mall.mall.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mallcloud.mall.common.core.constant.enums.mall.XGLEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel(value = "XglCouponViewModel", description = "星光里券视图")
@Data
@TableName("V_QPICLIST")
public class XglCouponViewModel implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * scheduleId+type 组成唯一标识
	 */
	@ApiModelProperty("档期码")
	@TableField("TCDYTPID")
	private String scheduleId;

	@ApiModelProperty("券种类")
	@TableField("TCDQTYPE")
	private String type;

	@ApiModelProperty("券名称")
	@TableField("TQNAME")
	private String name;

	@ApiModelProperty("券可兑换金额")
	@TableField("TCDQMONEY")
	private BigDecimal redeemMoney;

	@ApiModelProperty("售价")
	@TableField("VQLSJ")
	private BigDecimal salePrice;

	@ApiModelProperty("开始日期")
	@TableField("TCDSTARTDATE")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date startTime;

	@ApiModelProperty("结束日期")
	@TableField("TCDENDDATE")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date endTime;

	@ApiModelProperty("剩余比例")
	@TableField("SYBL")
	private String leftPercent;

	@ApiModelProperty("剩余数量")
	@TableField("SYSL")
	private String leftNum;

	@ApiModelProperty("已售数量")
	@TableField("LQSL")
	private String saleNum;

	@ApiModelProperty("券图片地址")
	@TableField("SQPQPICADD")
	private String imageBgUrl;

	@ApiModelProperty("券图片编码")
	@TableField("SQPQPICBM")
	private String imageBgId;

	/**
	 * {@link XGLEnum.PurposeEnum}
	 */
	@ApiModelProperty("券用途")
	@TableField("TCDQYT")
	private Integer purpose;

	@ApiModelProperty("收券规则")
	@TableField("SQGZ")
	private String rule;

}
